//
//  JZCreateGroupViewController.m
//  QuanZiChat
//
//  Created by 张洪林 on 15/11/17.
//  Copyright © 2015年 ZhongHongLin. All rights reserved.
//

#import "JZCreateGroupViewController.h"

@interface JZCreateGroupViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)NSMutableDictionary *souceDic;
@end

@implementation JZCreateGroupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //获取列表
    NSArray *array = [[NSArray alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Create.plist" ofType:nil]];
    [self.souceDic setValue:array forKey:@"Create"];
    // Do any additional setup after loading the view.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    NSArray * array = self.souceDic.allKeys;
    return array.count;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    NSArray * array = self.souceDic[self.souceDic.allKeys[section]];
    return array.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell3" forIndexPath:indexPath];
    NSArray * array = self.souceDic[self.souceDic.allKeys[indexPath.section]];
    cell.textLabel.text = array[indexPath.row][@"title"];
    return cell;
    
}

//懒加载
-(NSMutableDictionary *)souceDic{
    if (!_souceDic) {
        _souceDic = [NSMutableDictionary new];
    }
    return _souceDic;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
